﻿using Brilliant_see.App.Services;
using Brilliant_see.App.ViewModels;
using Brilliant_see.Core.Interfaces;
using Brilliant_see.DAL;
using Microsoft.Extensions.DependencyInjection;

namespace Brilliant_see.App
{
    public static class AppSetup
    {
        public static IServiceCollection AddAppServices(this IServiceCollection services)
        {
            //数据库
            services.AddSingleton<IDatabase, SqliteDatabase>();

            //服务
            services.AddSingleton<SearchService>();

            //视图模型
            services.AddSingleton<FavoriteViewModel>();

            services.AddTransient<SearchViewModel>();
            services.AddTransient<ComicBrowseViewModel>();

            return services;
        }
    }
}